<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$basic=$this->plugin_setting('basic');
$return['banner']=$basic['image'];
$return['basic']=$basic;
//我的关注
if($_RQ['op']=='main'){
	$id=$_RQ['id'];
	if(!$id){
		exi('未找到活动信息！','error');
	}
	$list=pdo_getall('jy_xiuvote_opus',array('uniacid'=>$_SESSION['uniacid'],'status'=>1,'rid'=>$id));
	$reply=pdo_get('jy_xiuvote_reply',array('uniacid'=>$_SESSION['uniacid'],'id'=>$id));
	if($list){
		$likes=0;
		$votenums=0;
		foreach($list as &$item){
			$item['user']=pdo_get('jy_xiuvote_user',array('mid'=>$item['mid'],'uniacid'=>$_SESSION['uniacid']));
			$item['member']=pdo_get('core_members',array('id'=>$item['mid'],'uniacid'=>$_SESSION['uniacid']));
			$item['votenums']=pdo_count('jy_xiuvote_votelog',array('oid'=>$item['id'],'uniacid'=>$_SESSION['uniacid']));
			$item['group']=pdo_get('jy_xiuvote_groups',array('uniacid'=>$_SESSION['uniacid'],'id'=>$reply['groupid']));
			$jifen=pdo_getsum('jy_xiuvote_sendlplog',array('oid'=>$item['id'],'uniacid'=>$_SESSION['uniacid'],'status'=>1),'jifen');
			if($item['group']['type']==1){
				$item['nums'] = $item['baselikenums']+$item['likes']+$jifen;
				$likes +=$item['nums'];
				$votenums +=$item['votenums'];
			}else{
				$item['nums'] = $item['basevotenums']+$item['votenums']+$jifen;
				$votenums +=$item['nums'];
				$likes +=$item['likes'];
			}
		}
	}
	paixu($list,'nums','desc');
	$return['likes']=$likes;
	$return['look']=pdo_getsum('jy_xiuvote_opus',array('rid'=>$_RQ['id'],'status'=>1,'isshow'=>1),'look');
	$return['votenums']=$votenums;
	$return['list']=$list;
	//$return['votesum']=count($list);
	exi($return);
}